3.65 \(\int \sin (c+d x) (a+b \sin ^2(c+d x)) \, dx\)

Optimal. Leaf size=31 \[ \frac {b \cos ^3(c+d x)}{3 d}-\frac {(a+b) \cos (c+d x)}{d} \]

[Out]

-(a+b)*cos(d*x+c)/d+1/3*b*cos(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {3013} \[ \frac {b \cos ^3(c+d x)}{3 d}-\frac {(a+b) \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sin[c + d*x]*(a + b*Sin[c + d*x]^2),x]

[Out]

-(((a + b)*Cos[c + d*x])/d) + (b*Cos[c + d*x]^3)/(3*d)

Rule 3013

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> -Dist[f^(-1), Subst[I
nt[(1 - x^2)^((m - 1)/2)*(A + C - C*x^2), x], x, Cos[e + f*x]], x] /; FreeQ[{e, f, A, C}, x] && IGtQ[(m + 1)/2
, 0]

Rubi steps

\begin {align*} \int \sin (c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx &=-\frac {\operatorname {Subst}\left (\int \left (a+b-b x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {(a+b) \cos (c+d x)}{d}+\frac {b \cos ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 54, normalized size = 1.74 \[ \frac {a \sin (c) \sin (d x)}{d}-\frac {a \cos (c) \cos (d x)}{d}-\frac {3 b \cos (c+d x)}{4 d}+\frac {b \cos (3 (c+d x))}{12 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[c + d*x]*(a + b*Sin[c + d*x]^2),x]

[Out]

-((a*Cos[c]*Cos[d*x])/d) - (3*b*Cos[c + d*x])/(4*d) + (b*Cos[3*(c + d*x)])/(12*d) + (a*Sin[c]*Sin[d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.42, size = 27, normalized size = 0.87 \[ \frac {b \cos \left (d x + c\right )^{3} - 3 \, {\left (a + b\right )} \cos \left (d x + c\right )}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

1/3*(b*cos(d*x + c)^3 - 3*(a + b)*cos(d*x + c))/d

________________________________________________________________________________________

giac [A]  time = 0.13, size = 40, normalized size = 1.29 \[ \frac {1}{3} \, {\left (\frac {\cos \left (d x + c\right )^{3}}{d} - \frac {3 \, \cos \left (d x + c\right )}{d}\right )} b - \frac {a \cos \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/3*(cos(d*x + c)^3/d - 3*cos(d*x + c)/d)*b - a*cos(d*x + c)/d

________________________________________________________________________________________

maple [A]  time = 0.33, size = 34, normalized size = 1.10 \[ \frac {-\frac {b \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}-a \cos \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(d*x+c)*(a+b*sin(d*x+c)^2),x)

[Out]

1/d*(-1/3*b*(2+sin(d*x+c)^2)*cos(d*x+c)-a*cos(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.33, size = 34, normalized size = 1.10 \[ \frac {{\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} b - 3 \, a \cos \left (d x + c\right )}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

1/3*((cos(d*x + c)^3 - 3*cos(d*x + c))*b - 3*a*cos(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 13.31, size = 27, normalized size = 0.87 \[ \frac {\frac {b\,{\cos \left (c+d\,x\right )}^3}{3}-\cos \left (c+d\,x\right )\,\left (a+b\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(c + d*x)*(a + b*sin(c + d*x)^2),x)

[Out]

((b*cos(c + d*x)^3)/3 - cos(c + d*x)*(a + b))/d

________________________________________________________________________________________

sympy [A]  time = 1.00, size = 58, normalized size = 1.87 \[ \begin {cases} - \frac {a \cos {\left (c + d x \right )}}{d} - \frac {b \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 b \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin ^{2}{\relax (c )}\right ) \sin {\relax (c )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(d*x+c)*(a+b*sin(d*x+c)**2),x)

[Out]

Piecewise((-a*cos(c + d*x)/d - b*sin(c + d*x)**2*cos(c + d*x)/d - 2*b*cos(c + d*x)**3/(3*d), Ne(d, 0)), (x*(a
+ b*sin(c)**2)*sin(c), True))

________________________________________________________________________________________